package com.example.nyf.mapper;

import com.example.nyf.entity.SysUserRole;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

public interface SysUserRoleMapper {

    @Delete("delete from sys_user_role where user_id = #{user_id}")
    public int deleteSysUserRoleByUserId(@Param("user_id") Integer user_id);

    @Insert("insert into sys_user_role(user_id, role_id) values(#{user_id}, #{role_id})")
    public int insertSysUserRole(SysUserRole sysUserRole);

    @Update("update sys_user_role set role_id = #{role_id} where user_id = #{user_id}")
    public int updateSysUserRole(SysUserRole sysUserRole);
}
